package com.gitee.tanmingjian.httptunnel.core.bean;

import java.util.Objects;

public class ConnectionInfo {

    private String host;
    private String proto;
    private String version;

    public ConnectionInfo(String host, String proto, String version) {
        this.host = host;
        this.proto = proto;
        this.version = version;
    }

    public String getHost() {
        return host;
    }

    public void setHost(String host) {
        this.host = host;
    }

    public String getProto() {
        return proto;
    }

    public void setProto(String proto) {
        this.proto = proto;
    }

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        ConnectionInfo that = (ConnectionInfo) o;
        return Objects.equals(host, that.host) && Objects.equals(proto, that.proto) && Objects.equals(version, that.version);
    }

    @Override
    public int hashCode() {
        return Objects.hash(host, proto, version);
    }

    @Override
    public String toString() {
        return "ConnectionInfo{" +
                "host='" + host + '\'' +
                ", proto='" + proto + '\'' +
                ", version='" + version + '\'' +
                '}';
    }
}
